An image forming apparatus has a function of correcting deviation of an image forming position in order to ensure the quality of an image formed. For example, JP-A-2008-225192 discloses an electrophotographic image forming apparatus including a plurality of photosensitive drums aligned along a belt for sheet transport, so that toner images of respective colors carried on the photosensitive drums are sequentially transferred onto a sheet on the belt. In this image forming apparatus, in order to correct a positional deviation, a pattern is formed on the belt surface using toner of each color and the amount of deviation from an ideal position of the image forming position of each color is calculated by measuring the position of a mark of each color included in the pattern with an optical sensor. The correction value for canceling the calculated amount of positional deviation of each color is stored in a memory, and the image forming position of each color is corrected based on the correction value read from the memory at the time of image formation.